Integrand size = 14, antiderivative size = 89 \[ \int \left (a+b \tanh ^3(c+d x)\right )^2 \, dx=\left (a^2+b^2\right ) x+\frac {2 a b \log (\cosh (c+d x))}{d}-\frac {b^2 \tanh (c+d x)}{d}-\frac {a b \tanh ^2(c+d x)}{d}-\frac {b^2 \tanh ^3(c+d x)}{3 d}-\frac {b^2 \tanh ^5(c+d x)}{5 d} \]
(a^2+b^2)*x+2*a*b*ln(cosh(d*x+c))/d-b^2*tanh(d*x+c)/d-a*b*tanh(d*x+c)^2/d- 1/3*b^2*tanh(d*x+c)^3/d-1/5*b^2*tanh(d*x+c)^5/d
Time = 0.75 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.07 \[ \int \left (a+b \tanh ^3(c+d x)\right )^2 \, dx=-\frac {15 \left ((a+b)^2 \log (1-\tanh (c+d x))-(a-b)^2 \log (1+\tanh (c+d x))\right )+30 b^2 \tanh (c+d x)+30 a b \tanh ^2(c+d x)+10 b^2 \tanh ^3(c+d x)+6 b^2 \tanh ^5(c+d x)}{30 d} \]
-1/30*(15*((a + b)^2*Log[1 - Tanh[c + d*x]] - (a - b)^2*Log[1 + Tanh[c + d *x]]) + 30*b^2*Tanh[c + d*x] + 30*a*b*Tanh[c + d*x]^2 + 10*b^2*Tanh[c + d* x]^3 + 6*b^2*Tanh[c + d*x]^5)/d
Time = 0.29 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.01, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4144, 2341, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \left (a+b \tanh ^3(c+d x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a+i b \tan (i c+i d x)^3\right )^2dx\) |
\(\Big \downarrow \) 4144 |
\(\displaystyle \frac {\int \frac {\left (b \tanh ^3(c+d x)+a\right )^2}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{d}\) |
\(\Big \downarrow \) 2341 |
\(\displaystyle \frac {\int \left (-b^2 \tanh ^4(c+d x)-b^2 \tanh ^2(c+d x)-2 a b \tanh (c+d x)-b^2+\frac {a^2+2 b \tanh (c+d x) a+b^2}{1-\tanh ^2(c+d x)}\right )d\tanh (c+d x)}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \text {arctanh}(\tanh (c+d x))-a b \tanh ^2(c+d x)-a b \log \left (1-\tanh ^2(c+d x)\right )-\frac {1}{5} b^2 \tanh ^5(c+d x)-\frac {1}{3} b^2 \tanh ^3(c+d x)-b^2 \tanh (c+d x)}{d}\) |
((a^2 + b^2)*ArcTanh[Tanh[c + d*x]] - a*b*Log[1 - Tanh[c + d*x]^2] - b^2*T anh[c + d*x] - a*b*Tanh[c + d*x]^2 - (b^2*Tanh[c + d*x]^3)/3 - (b^2*Tanh[c + d*x]^5)/5)/d
3.3.57.3.1 Defintions of rubi rules used
Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq* (a + b*x^2)^p, x], x] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
Int[((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(a + b* (ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Time = 0.09 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.02
method | result | size |
parallelrisch | \(\frac {-3 \tanh \left (d x +c \right )^{5} b^{2}-5 b^{2} \tanh \left (d x +c \right )^{3}+15 a^{2} d x -30 a b d x +15 b^{2} d x -15 \tanh \left (d x +c \right )^{2} a b -30 \ln \left (1-\tanh \left (d x +c \right )\right ) a b -15 b^{2} \tanh \left (d x +c \right )}{15 d}\) | \(91\) |
derivativedivides | \(\frac {-\frac {\tanh \left (d x +c \right )^{5} b^{2}}{5}-\frac {b^{2} \tanh \left (d x +c \right )^{3}}{3}-\tanh \left (d x +c \right )^{2} a b -b^{2} \tanh \left (d x +c \right )-\frac {\left (a^{2}+2 a b +b^{2}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(99\) |
default | \(\frac {-\frac {\tanh \left (d x +c \right )^{5} b^{2}}{5}-\frac {b^{2} \tanh \left (d x +c \right )^{3}}{3}-\tanh \left (d x +c \right )^{2} a b -b^{2} \tanh \left (d x +c \right )-\frac {\left (a^{2}+2 a b +b^{2}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(99\) |
parts | \(a^{2} x +\frac {b^{2} \left (-\frac {\tanh \left (d x +c \right )^{5}}{5}-\frac {\tanh \left (d x +c \right )^{3}}{3}-\tanh \left (d x +c \right )-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {2 a b \left (-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}\) | \(105\) |
risch | \(a^{2} x -2 a b x +b^{2} x -\frac {4 a b c}{d}+\frac {2 b \left (30 a \,{\mathrm e}^{8 d x +8 c}+45 b \,{\mathrm e}^{8 d x +8 c}+90 a \,{\mathrm e}^{6 d x +6 c}+90 b \,{\mathrm e}^{6 d x +6 c}+90 a \,{\mathrm e}^{4 d x +4 c}+140 b \,{\mathrm e}^{4 d x +4 c}+30 \,{\mathrm e}^{2 d x +2 c} a +70 b \,{\mathrm e}^{2 d x +2 c}+23 b \right )}{15 d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{5}}+\frac {2 a b \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}\) | \(163\) |
1/15*(-3*tanh(d*x+c)^5*b^2-5*b^2*tanh(d*x+c)^3+15*a^2*d*x-30*a*b*d*x+15*b^ 2*d*x-15*tanh(d*x+c)^2*a*b-30*ln(1-tanh(d*x+c))*a*b-15*b^2*tanh(d*x+c))/d
Leaf count of result is larger than twice the leaf count of optimal. 2074 vs. \(2 (85) = 170\).
Time = 0.29 (sec) , antiderivative size = 2074, normalized size of antiderivative = 23.30 \[ \int \left (a+b \tanh ^3(c+d x)\right )^2 \, dx=\text {Too large to display} \]
1/15*(15*(a^2 - 2*a*b + b^2)*d*x*cosh(d*x + c)^10 + 150*(a^2 - 2*a*b + b^2 )*d*x*cosh(d*x + c)*sinh(d*x + c)^9 + 15*(a^2 - 2*a*b + b^2)*d*x*sinh(d*x + c)^10 + 15*(5*(a^2 - 2*a*b + b^2)*d*x + 4*a*b + 6*b^2)*cosh(d*x + c)^8 + 15*(45*(a^2 - 2*a*b + b^2)*d*x*cosh(d*x + c)^2 + 5*(a^2 - 2*a*b + b^2)*d* x + 4*a*b + 6*b^2)*sinh(d*x + c)^8 + 120*(15*(a^2 - 2*a*b + b^2)*d*x*cosh( d*x + c)^3 + (5*(a^2 - 2*a*b + b^2)*d*x + 4*a*b + 6*b^2)*cosh(d*x + c))*si nh(d*x + c)^7 + 30*(5*(a^2 - 2*a*b + b^2)*d*x + 6*a*b + 6*b^2)*cosh(d*x + c)^6 + 30*(105*(a^2 - 2*a*b + b^2)*d*x*cosh(d*x + c)^4 + 5*(a^2 - 2*a*b + b^2)*d*x + 14*(5*(a^2 - 2*a*b + b^2)*d*x + 4*a*b + 6*b^2)*cosh(d*x + c)^2 + 6*a*b + 6*b^2)*sinh(d*x + c)^6 + 60*(63*(a^2 - 2*a*b + b^2)*d*x*cosh(d*x + c)^5 + 14*(5*(a^2 - 2*a*b + b^2)*d*x + 4*a*b + 6*b^2)*cosh(d*x + c)^3 + 3*(5*(a^2 - 2*a*b + b^2)*d*x + 6*a*b + 6*b^2)*cosh(d*x + c))*sinh(d*x + c )^5 + 10*(15*(a^2 - 2*a*b + b^2)*d*x + 18*a*b + 28*b^2)*cosh(d*x + c)^4 + 10*(315*(a^2 - 2*a*b + b^2)*d*x*cosh(d*x + c)^6 + 105*(5*(a^2 - 2*a*b + b^ 2)*d*x + 4*a*b + 6*b^2)*cosh(d*x + c)^4 + 15*(a^2 - 2*a*b + b^2)*d*x + 45* (5*(a^2 - 2*a*b + b^2)*d*x + 6*a*b + 6*b^2)*cosh(d*x + c)^2 + 18*a*b + 28* b^2)*sinh(d*x + c)^4 + 40*(45*(a^2 - 2*a*b + b^2)*d*x*cosh(d*x + c)^7 + 21 *(5*(a^2 - 2*a*b + b^2)*d*x + 4*a*b + 6*b^2)*cosh(d*x + c)^5 + 15*(5*(a^2 - 2*a*b + b^2)*d*x + 6*a*b + 6*b^2)*cosh(d*x + c)^3 + (15*(a^2 - 2*a*b + b ^2)*d*x + 18*a*b + 28*b^2)*cosh(d*x + c))*sinh(d*x + c)^3 + 15*(a^2 - 2...
Time = 0.15 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.12 \[ \int \left (a+b \tanh ^3(c+d x)\right )^2 \, dx=\begin {cases} a^{2} x + 2 a b x - \frac {2 a b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a b \tanh ^{2}{\left (c + d x \right )}}{d} + b^{2} x - \frac {b^{2} \tanh ^{5}{\left (c + d x \right )}}{5 d} - \frac {b^{2} \tanh ^{3}{\left (c + d x \right )}}{3 d} - \frac {b^{2} \tanh {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{3}{\left (c \right )}\right )^{2} & \text {otherwise} \end {cases} \]
Piecewise((a**2*x + 2*a*b*x - 2*a*b*log(tanh(c + d*x) + 1)/d - a*b*tanh(c + d*x)**2/d + b**2*x - b**2*tanh(c + d*x)**5/(5*d) - b**2*tanh(c + d*x)**3 /(3*d) - b**2*tanh(c + d*x)/d, Ne(d, 0)), (x*(a + b*tanh(c)**3)**2, True))
Leaf count of result is larger than twice the leaf count of optimal. 194 vs. \(2 (85) = 170\).
Time = 0.27 (sec) , antiderivative size = 194, normalized size of antiderivative = 2.18 \[ \int \left (a+b \tanh ^3(c+d x)\right )^2 \, dx=\frac {1}{15} \, b^{2} {\left (15 \, x + \frac {15 \, c}{d} - \frac {2 \, {\left (70 \, e^{\left (-2 \, d x - 2 \, c\right )} + 140 \, e^{\left (-4 \, d x - 4 \, c\right )} + 90 \, e^{\left (-6 \, d x - 6 \, c\right )} + 45 \, e^{\left (-8 \, d x - 8 \, c\right )} + 23\right )}}{d {\left (5 \, e^{\left (-2 \, d x - 2 \, c\right )} + 10 \, e^{\left (-4 \, d x - 4 \, c\right )} + 10 \, e^{\left (-6 \, d x - 6 \, c\right )} + 5 \, e^{\left (-8 \, d x - 8 \, c\right )} + e^{\left (-10 \, d x - 10 \, c\right )} + 1\right )}}\right )} + 2 \, a b {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + a^{2} x \]
1/15*b^2*(15*x + 15*c/d - 2*(70*e^(-2*d*x - 2*c) + 140*e^(-4*d*x - 4*c) + 90*e^(-6*d*x - 6*c) + 45*e^(-8*d*x - 8*c) + 23)/(d*(5*e^(-2*d*x - 2*c) + 1 0*e^(-4*d*x - 4*c) + 10*e^(-6*d*x - 6*c) + 5*e^(-8*d*x - 8*c) + e^(-10*d*x - 10*c) + 1))) + 2*a*b*(x + c/d + log(e^(-2*d*x - 2*c) + 1)/d + 2*e^(-2*d *x - 2*c)/(d*(2*e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + 1))) + a^2*x
Time = 0.30 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.60 \[ \int \left (a+b \tanh ^3(c+d x)\right )^2 \, dx=\frac {30 \, a b \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + 15 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (23 \, b^{2} + 15 \, {\left (2 \, a b + 3 \, b^{2}\right )} e^{\left (8 \, d x + 8 \, c\right )} + 90 \, {\left (a b + b^{2}\right )} e^{\left (6 \, d x + 6 \, c\right )} + 10 \, {\left (9 \, a b + 14 \, b^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} + 10 \, {\left (3 \, a b + 7 \, b^{2}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{5}}}{15 \, d} \]
1/15*(30*a*b*log(e^(2*d*x + 2*c) + 1) + 15*(a^2 - 2*a*b + b^2)*(d*x + c) + 2*(23*b^2 + 15*(2*a*b + 3*b^2)*e^(8*d*x + 8*c) + 90*(a*b + b^2)*e^(6*d*x + 6*c) + 10*(9*a*b + 14*b^2)*e^(4*d*x + 4*c) + 10*(3*a*b + 7*b^2)*e^(2*d*x + 2*c))/(e^(2*d*x + 2*c) + 1)^5)/d
Time = 1.87 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.02 \[ \int \left (a+b \tanh ^3(c+d x)\right )^2 \, dx=x\,\left (a^2+2\,a\,b+b^2\right )-\frac {b^2\,\mathrm {tanh}\left (c+d\,x\right )}{d}-\frac {b^2\,{\mathrm {tanh}\left (c+d\,x\right )}^3}{3\,d}-\frac {b^2\,{\mathrm {tanh}\left (c+d\,x\right )}^5}{5\,d}-\frac {2\,a\,b\,\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )}{d}-\frac {a\,b\,{\mathrm {tanh}\left (c+d\,x\right )}^2}{d} \]